﻿using iTool.ClusterComponent;
using iTool.Common.Responses;
using Orleans.Concurrency;

namespace iTool.Core
{
    public interface IRequestIdempotenceService : iToolServiceWithIntegerCompoundKey
    {
        Task<bool> StartIfNotExistAsync(string token, int timeout);

        [AlwaysInterleave]
        Task SetResultAsync(string token, DoWorkResponse result);

        [AlwaysInterleave]
        Task<DoWorkResponse> GetResultAsync(string token);
    }
}
